package org.sageras.util.ExcelUtil;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.Iterator;
import java.util.List;

import org.apache.commons.lang3.text.StrBuilder;

import com.test.model.Student;

public class Test {
	public static void main(String[] args) throws IOException,
			IllegalArgumentException, IllegalAccessException {
		ExcelLogs logs = new ExcelLogs();
		// InputStream in = new FileInputStream(new File(
		// "D:\\学生信息表_（2014.6.27）.xls"));
		// Collection<Student> list = ExcelUtil.importExcel(Student.class, in,
		// logs, 3);
		// for (Student student : list) {
		// System.out.println(student);
		// }
		// for (ExcelLog excelLog : logs.getLogList()) {
		// System.out.println(excelLog.getSheetIndex() + ":"
		// + excelLog.getRowNum() + "：" + excelLog.getLog());
		// }
		List<Student> list2 = new ArrayList<Student>();
		for (int i = 0; i < 10; i++) {
			Student student = new Student();
			student.setIndex(i);
			student.setName("姓名:" + i);
			student.setSfz("身份证" + i);
			student.setZkz("准考证" + i);
			student.setZy("专业" + i);
			student.setRxsj(new Date());
			list2.add(student);
		}
		ExcelUtil.exportExcel("测试", list2, new FileOutputStream(new File(
				"D:/TEST.xls")), Student.class);

	}
}
